<?php

class Application_Model_DbTable_Usuario extends Zend_Db_Table_Abstract
{

    protected $_name = 'usuarios';

	public function getListaUsuarios($where){
		$select = $this->select()
					->setIntegrityCheck(false)
					->from(array("u"=> $this->_name))
					->joinInner(array('pe'=>'perfil'), 'pe.id = u.id_perfil', array("nome_perfil" => 'pe.nome'))
					->joinLeft(array('pa'=>'paroquia'), 'pa.id_paroquia = u.id_paroquia', array("nome_paroquia" => 'pa.nome', 'sigla_paroquia' => 'pa.sigla'))
					->where($where);
		return $this->fetchAll($select);
	}
    
}

